<script type="text/javascript" >
    jQuery(document).ready(function() {
        jQuery(".galleryFlickr a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'
        ,keyboard_shortcuts: false});
        stFlickrToolbox.sortColumn();
        stFlickrToolbox.shortAction();
        stFlickrToolbox.pagingCallbackFunction = function(data){
            data['set_id'] = '<?php echo $set_id ?>';
        };

        stFlickrToolbox.sortCallbackFunction = function(data){
            data['set_id'] = '<?php echo $set_id ?>';
        };
    });
</script>
<div class="w100p bgl">
    <div class="w100p bgr">
        <div class="inner_container galleryFlickr">
            <br />
            <table class="widefat galleryVideo" cellspacing="0">
                <thead>
                    <tr>
                        <?php print_column_headers('stFlickrToolbox_st_flickr'); ?>
                    </tr>
                </thead>
                <tbody>
                    <?php
                        if (count($results) > 0) {
                            $tr_class = "";
                            foreach ($results as $result) {
                                if( empty($tr_class) || $tr_class == "class='bg_gray2'"){
                                    $tr_class = "class='bg_gray1'";
                                }else{
                                    $tr_class = "class='bg_gray2'";
                                }
                                $series = explode('|*|', $result->series);
                                echo "<tr id='$result->id' $tr_class>"
                                //. "<td>" . $result->id . "</td>"
                                . "<td ><div class='pos_rel'>" . stFlickrToolboxFunctions::limitWords($result->title, 5)
                                . "<div class=\"row-actions short_action\">";
                                echo "<span action='flickrEdit' short_action='' id='$result->id'>Edit | </span>"
                                . "<span class='trash' short_action='delete' id='$result->id' confirm='Are you sure you want to delete this video?'>Trash </span>"
                                . "</div></div>"
                                . "</td>"
                                . "<td align='center'><a href=\"http://farm{$series[2]}.static.flickr.com/{$series[1]}/{$result->photo_id}_{$series[0]}_z.jpg\" rel=\"prettyPhoto\" title=\"\">
                                <img height='70' src='http://farm{$series[2]}.static.flickr.com/{$series[1]}/{$result->photo_id}_{$series[0]}_m.jpg' alt='' />
                                </a>
                                </td>"
                                . "<td>" . $result->settitle . "</td>"
                                . "<td>";
                                 if($permission == 1 && $option_facebook['session_key'] != ''){
                                  echo "<img src='".str_replace('Flickr','Publish',$config['imagesUrl'])."facebook.gif' onclick=\"jQuery.prettyPhoto.loadPage('publish_popup&pic=http://farm{$series[2]}.static.flickr.com/{$series[1]}/{$result->photo_id}_{$series[0]}_m.jpg&title={$result->title}&type=flick', null,location.href.split('?')[0]+'?page=stPublishToolbox')\" style='cursor:pointer;' />";
                                 }
                                  if($permission_twitter == 1 && $option_twitter['user_token'] != ''){
                                  echo "&nbsp;<img src='".str_replace('Flickr','Publish',$config['imagesUrl'])."twitter.png' onclick=\"jQuery.prettyPhoto.loadPage('publish_popup&img=http://www.flickr.com/photos/{$option['flickr_user_id']}/{$result->photo_id}/&title={$result->title}&type=flick&pic=http://farm{$series[2]}.static.flickr.com/{$series[1]}/{$result->photo_id}_{$series[0]}_m.jpg', null,location.href.split('?')[0]+'?page=stTwitterToolbox')\" style='cursor:pointer;' /></td>";
                                  }
                                //. "<td>" . stFlickrToolboxFunctions::limitWords($result->description, 15) . "</td>"
                                //. "<td>" . $result->category . "</td>"
                                //. "<td>" . stFlickrToolboxFunctions::limitWords(str_replace('|*|', ', ', $result->tag), 5) . "</td>"
                                //. "<td>" . $result->duration . "</td>"
                                //. "<td>" . $result->view_count . "</td>"
                                //. "<td>" . $result->playlist_name . "</td>"
                                echo "</tr>"
                                ;
                            }
                        }
                    ?>
                    </tbody>
                </table>
                <div class="page_d">
                <?php echo $pagination ?>
                <div class="cl"></div>
            </div>

        </div>
    </div>
</div>